Features: Testing Ajax Sample Components

Scenario: 01. Verify main page                          
    Given navigate to the page "http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/"
    When page loaded after timeout in 0 seconds
    And text "What is the ASP.NET AJAX Control Toolkit?" present on the page
    
Scenario: 02. AsyncFileUpload Demonstration                          
    Given navigate to the page "http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/AsyncFileUpload/AsyncFileUpload.aspx"
	When page loaded after timeout in 0 seconds
   	And text "AsyncFileUpload Demonstration" present on the page
    Then upload "C:\Documents and Settings\ochubey\Desktop\cover.txt" file using Ajax component with id=ctl00_SampleContent_AsyncFileUpload1_ctl02 
    And check if text component with id="ctl00_SampleContent_uploadResult" contain text "Uploaded size: 9"
    
Scenario: 03. Cascading DropDown Demonstration
    Given navigate to the page "http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/CascadingDropDown/CascadingDropDown.aspx"
    When page loaded after timeout in 0 seconds
    And text "CascadingDropDown Demonstration" present on the page
	Then verify cascading functionality for each value of following drop lists
	||
	|"ctl00_SampleContent_DropDownList1"|
	|"ctl00_SampleContent_DropDownList2"|
	|"ctl00_SampleContent_DropDownList3"|
	
Scenario: 04. ComboBox Demonstration
    Given navigate to the page "http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ComboBox/ComboBox.aspx"
    When page loaded after timeout in 0 seconds
    And text "ComboBox Demonstration" present on the page
	Then serch in text component with id="ctl00_SampleContent_ComboBox1_TextBox" text "Oscar"
	And press button with id="ctl00_SampleContent_ManualPostBackButton"
	When page loaded after timeout in 0 seconds
	When wait text_field component with id="ctl00_SampleContent_FeedbackSelectedIndexChangedLabel" to load
	And check if text component with id="ctl00_SampleContent_FeedbackSelectedIndexChangedLabel" contain text "You changed your selection to: Oscar"
	Then check checkbox componen with id="ctl00_SampleContent_AutoPostBackCheckBox"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_AutoPostBackSourceLabel" contain text "True"
	Then uncheck checkbox componen with id="ctl00_SampleContent_AutoPostBackCheckBox"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_AutoPostBackSourceLabel" contain text "False"
	Then select radiobutton componen with id="ctl00_SampleContent_DropDownStyleRadioButtonList_0"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_DropDownStyleSourceLabel" contain text "Simple"
	Then select radiobutton componen with id="ctl00_SampleContent_DropDownStyleRadioButtonList_1"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_DropDownStyleSourceLabel" contain text "DropDown"
	Then select radiobutton componen with id="ctl00_SampleContent_DropDownStyleRadioButtonList_2"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_DropDownStyleSourceLabel" contain text "DropDownList"
	Then select radiobutton componen with id="ctl00_SampleContent_AutoCompleteModeRadioButtonList_0"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_AutoCompleteModeSourceLabel" contain text "None"
	Then select radiobutton componen with id="ctl00_SampleContent_AutoCompleteModeRadioButtonList_1"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_AutoCompleteModeSourceLabel" contain text "Suggest"
	Then select radiobutton componen with id="ctl00_SampleContent_AutoCompleteModeRadioButtonList_2"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_AutoCompleteModeSourceLabel" contain text "Append"
	Then select radiobutton componen with id="ctl00_SampleContent_AutoCompleteModeRadioButtonList_3"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_AutoCompleteModeSourceLabel" contain text "SuggestAppend"
	Then check checkbox componen with id="ctl00_SampleContent_CaseSensitiveCheckBox"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_CaseSensitiveSourceLabel" contain text "True"
	Then uncheck checkbox componen with id="ctl00_SampleContent_CaseSensitiveCheckBox"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_CaseSensitiveSourceLabel" contain text "False"
	Then select radiobutton componen with id="ctl00_SampleContent_CssClassRadioButtonList_1"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_CssClassSourceLabel" contain text "AjaxToolkitStyle"
	Then select radiobutton componen with id="ctl00_SampleContent_CssClassRadioButtonList_2"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_CssClassSourceLabel" contain text "AquaStyle"
	Then select radiobutton componen with id="ctl00_SampleContent_CssClassRadioButtonList_3"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_CssClassSourceLabel" contain text "WindowsStyle"
	Then select radiobutton componen with id="ctl00_SampleContent_CssClassRadioButtonList_0"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_CssClassSourceLabel" contain text ""
	Then select radiobutton componen with id="ctl00_SampleContent_ItemInsertLocationRadioButtonList_1"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_ItemInsertLocationSourceLabel" contain text "Prepend"
	Then select radiobutton componen with id="ctl00_SampleContent_ItemInsertLocationRadioButtonList_2"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_ItemInsertLocationSourceLabel" contain text "OrdinalText"
	Then select radiobutton componen with id="ctl00_SampleContent_ItemInsertLocationRadioButtonList_3"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_ItemInsertLocationSourceLabel" contain text "OrdinalValue"
	Then select radiobutton componen with id="ctl00_SampleContent_ItemInsertLocationRadioButtonList_0"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_ItemInsertLocationSourceLabel" contain text "Append"
	
Scenario: 05. List Search Extender Demonstration
    Given navigate to the page "http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ListSearch/ListSearch.aspx"
    When page loaded after timeout in 0 seconds
    And text "ListSearchExtender Demonstration" present on the page
	Then select each value in checkList with id="ctl00_SampleContent_ListBox1"
	Then select each value in checkList with id="ctl00_SampleContent_DropDownList1"

Scenario: 06. DropDown Demonstration
    Given navigate to the page "http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/DropDown/DropDown.aspx"
    When page loaded after timeout in 0 seconds
    And text "DropDown Demonstration" present on the page
	And press button with id="ctl00_SampleContent_TextLabel_dropWrapper"
	And press button with id="ctl00_SampleContent_Option1"
	When wait text_field component with id="ctl00_SampleContent_lblSelection" to load
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_lblSelection" contain text "You selected Mocha Blast."
	And press button with id="ctl00_SampleContent_TextLabel_dropWrapper"
	And press button with id="ctl00_SampleContent_Option2"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_lblSelection" contain text "You selected Java Cyclone."
	And press button with id="ctl00_SampleContent_TextLabel_dropWrapper"
	And press button with id="ctl00_SampleContent_Option3"
	When page loaded after timeout in 3 seconds
	And check if text component with id="ctl00_SampleContent_lblSelection" contain text "You selected Dry Fruit."

Scenario: 07. Numeric Up Down Demonstration
    Given navigate to the page "http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/NumericUpDown/NumericUpDown.aspx"
    When page loaded after timeout in 0 seconds
    And text "NumericUpDown Demonstration" present on the page
	Then verify if value of component with id="ctl00_SampleContent_TextBox1" changes after button with id="ctl00_SampleContent_TextBox1_bUp" was pressed
	Then verify if value of component with id="ctl00_SampleContent_TextBox2" changes after button with id="ctl00_SampleContent_TextBox2_bUp" was pressed
	Then verify if value of component with id="ctl00_SampleContent_TextBox3" changes after button with id="ctl00_SampleContent_TextBox3_bUp" was pressed
	Then verify if value of component with id="ctl00_SampleContent_TextBox4" changes after button with id="ctl00_SampleContent_img2" was pressed
  
Scenario: 08. Rating Demonstration
    Given navigate to the page "http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Rating/Rating.aspx"
    When page loaded after timeout in 0 seconds
    And text "Rating Demonstration" present on the page
	Then select each value in checkList with id="ctl00_SampleContent_lstAlign"
	When page loaded after timeout in 1 seconds
	And press button with id="ctl00_SampleContent_btnSubmit"
	When wait text_field component with id="ctl00_SampleContent_lblResponse" to load
	When page loaded after timeout in 2 seconds
	And text "You prefer Thai food that is" present on the page
	Then select each value in checkList with id="ctl00_SampleContent_lstDirection"
	When page loaded after timeout in 1 seconds
	And press button with id="ctl00_SampleContent_btnSubmit"
	When page loaded after timeout in 3 seconds
	And text "You prefer Thai food that is" present on the page